-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce fine-grained form and flow validation #114
Conversation
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #114 +/- ##
==========================================
+ Coverage 20.20% 21.39% +1.19%
==========================================
Files 54 54
Lines 797 818 +21
Branches 74 79 +5
==========================================
+ Hits 161 175 +14
- Misses 630 639 +9
+ Partials 6 4 -2 ☔ View full report in Codecov by Sentry. |
We will we use the backend validation here also in the future when saving? |
Also will we have the first save be a create basically then update? |
Definitely, the way I envision it is a 3-layer validation. First is basic form validation (no missing fields), second is flow validation (a DAG), and third would be backend validation. Whether we have it proactive (validation API) or reactive, we can support any way.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
looks good to me, might want to revisit when we have those integrated how the save functionality will look like with the different validation, since as you commented save = create or update and launch is provision I assume. wonder if we should have differentiation for just quick create and launch too, or like we force to save and then launch, and obvious that the first save is equal to create |
Right this will all need to be revisited when things are more finalized, for now we have placeholders and TODOs in code. This is just incremental. |
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com> (cherry picked from commit 5231f09)
Description
This PR improves the overall validation logic on the workflow editor:
Save
button. This is done by propagating callback fnonFormChange
to the low-level form components, and performing form validation and submission when clickingSave
buttonworkspaceFlowState
fromworkspace
to parent componentresizableWorkspace
. This allows us to perform validation in a consistent way, and pass the same, updated workflow to all downstream components.saveWorkflow
to perform only save/updateAdditional changes:
Submit
button since we have the logic available in theSave
button nowNote that the form validation logic is complete - however, the flow validation logic is still in TODO state; for now, it always succeeds / is valid.
Screenshots:
Form validation:
Flow validation:
Demo videos:
Form validation integrated with
Save
button being disabled/enabled depending on unsaved changes. Note that on submitting / clickingSave
, all invalid fields are highlighted appropriately, across all components. And, once everything is valid, the callout does not appear when saving.screen-capture.18.webm
Flow validation integrated with
Save
button being disabled/enabled depending on unsaved changes. Ignore the callout as that logic is still a placeholder.screen-capture.19.webm
Issues Resolved
Resolves #5
Check List
--signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.